{% extends "base.html" %}
{% block header %}

<script src="/static/js/index.js"></script>


{% endblock%}
{% block title %} Query Analyse System
{% endblock%}

{% block content %}
   
     <div class="span12">
<div class="well">
       <table class="table table-bordered">
         <thead>
           <tr>
           <th>Rank</th>
             <th>Query</th>
            <th>Date</th>

             <th>Frequency</th>
             <th>Click</th>
           </tr>
         </thead>
         <tbody>
 			{% if result_list.object_list %} 		
 			{% for item in result_list.object_list %}
 			<tr>
        <td><a>{{item.index}}</a></td>
 			   <td><a target="_blank" href="http://180.153.228.57:2057/search?dbg=1&query={{item.query}}">{{ item.query }}</a></td>
 			    <td><a>{{item.date}}</a></td>
 				<td><a>{{ item.freq }}</a></td>
 				<td><a>{{item.click}}</a></td>
 			</tr>
 			{% endfor %}
 			<div class="pagination">
                 <ul>
                     {% if result_list.has_previous %}
                     <li><a href="{{current_url}}&page={{ result_list.previous_page_number }}">&laquo;</a></li> 
                     {% else %}
                     <li class="disabled"><a>&laquo;</a></li> 
                     {% endif %}
                     {% for p in page_range %}
                     {% ifequal p result_list.number %}
                     <li class="active"><a href="#">{{p}}</a></li>
                     {% else %}
                     <li><a href="{{current_url}}&page={{p}}">{{p}}</a></li>
                     {% endifequal %}
                     {% endfor %}
                     {% if result_list.has_next %}
                     <li><a href="{{current_url}}&page={{ result_list.next_page_number }}">&raquo;</a></li>
                     {% else %}
                      <li class="disabled"><a>&raquo;</a></li>
                     {% endif %}
                          

                 </ul>
               </div>
 			{% else %}
 			<tr><td colspan="4"><a class="label  label-important">No Result Found</a>
 			</td></tr>
 			{% endif %}
         </tbody>
       
       </table>
    {% if result_list.object_list %} 		   
 	<div class="pagination">
         <ul>
             {% if result_list.has_previous %}
             <li><a href="{{current_url}}&page={{ result_list.previous_page_number }}">&laquo;</a></li> 
             {% else %}
             <li class="disabled"><a>&laquo;</a></li> 
             {% endif %}
             {% for p in page_range %}

             {% ifequal p result_list.number %}
             <li class="active"><a href="#">{{p}}</a></li>
             {% else %}
             <li><a href="{{current_url}}&page={{p}}">{{p}}</a></li>
             {% endifequal %}

             {% endfor %}
             {% if result_list.has_next %}
             <li><a href="{{current_url}}&page={{ result_list.next_page_number }}">&raquo;</a></li>
             {% else %}
              <li class="disabled"><a>&raquo;</a></li>
             {% endif %}
                  

         </ul>
       </div>
    
    {% endif %} 		
</div>
     </div>

{% endblock %}
